"""
用装饰器来实现单例模式
"""
from functools import wraps

def singleton(cls):

    instances = {}
    @wraps(cls)
    def wrapper(*args, **kwargs):
        if cls not in instances:
            instances[cls] = cls(*args, **kwargs)
        return instances[cls]
    return wrapper
@singleton
class President:

    pass